<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2015/7/1
 * Time: 21:56
 */

namespace common\models\Service;


use common\models\CommonFunction;

class UserLog {
    public static function set($param){
        //用户日志表
        $userLogModel = new \common\models\DAO\UserLog();
        $userLogModel->userID = $param['userID'];
        $userLogModel->operatTime = time();
        $userLogModel->ip = CommonFunction::get_client_ip();
        if(isset($param['chargeID']))
            $userLogModel->chargeID = $param['chargeID'];
        if(isset($param['investID']))
            $userLogModel->investID = $param['investID'];
        if(isset($param['productID']))
            $userLogModel->productID = $param['productID'];
        if(isset($param['sourceID']))
            $userLogModel->sourceID = $param['sourceID'];
        if(isset($param['hongBao']))
            $userLogModel->hongBao = $param['hongBao'];
        if(isset($param['rate']))
            $userLogModel->rate = $param['rate'];
        if(isset($param['coupon']))
            $userLogModel->coupon = $param['coupon'];
        $userLogModel->desc = $param['desc'];
        $userLogModel->money = $param['money'];
        return $userLogModel->save();
    }
}